﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Controls="clr-namespace:CBR.Components.Controls">


    <ControlTemplate x:Key="starTemplate"  TargetType="{x:Type ToggleButton}">
        <Border Background="Transparent">
            <Viewbox>
				<Path Name="star" Fill="{DynamicResource CbrBorderBrushNormal}" Data="F1 M 145.637,174.227L 127.619,110.39L 180.809,70.7577L 114.528,68.1664L 93.2725,5.33333L 70.3262,67.569L 4,68.3681L 56.0988,109.423L 36.3629,172.75L 91.508,135.888L 145.637,174.227 Z" Stretch="Uniform"/>
            </Viewbox>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsChecked" Value="True">
				<Setter TargetName="star" Property="Fill" Value="{DynamicResource CbrForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="{x:Type Controls:RatingControl}" TargetType="{x:Type Controls:RatingControl}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Controls:RatingControl}">
                    <StackPanel x:Name="PART_RatingContentPanel" Orientation="Horizontal">
                        <ToggleButton Margin="0" Padding="0" Tag="1" Cursor="Hand" Template="{StaticResource starTemplate}" IsTabStop="False" />
                        <ToggleButton Margin="0" Padding="0" Tag="2" Cursor="Hand" Template="{StaticResource starTemplate}" IsTabStop="False" />
                        <ToggleButton Margin="0" Padding="0" Tag="3" Cursor="Hand" Template="{StaticResource starTemplate}" IsTabStop="False" />
                        <ToggleButton Margin="0" Padding="0" Tag="4" Cursor="Hand" Template="{StaticResource starTemplate}" IsTabStop="False" />
                        <ToggleButton Margin="0" Padding="0" Tag="5" Cursor="Hand" Template="{StaticResource starTemplate}" IsTabStop="False" />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>